package com.smartcommunity.api.device;

import com.alibaba.fastjson.JSONObject;
import com.smartcommunity.api.device.fallBack.DeviceApiFallBack;
import com.smartcommunity.bean.entity.Camera;
import com.smartcommunity.bean.model.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: DeviceApi
 * @Description: 调用设备服务接口
 * @author: minsheng
 * @Date: 2019/1/14 15:02
 * @Company:
 * @version V1.5.0
 */
@FeignClient(value = "np-zhsq-device-service",fallback = DeviceApiFallBack.class)
public interface DeviceApi {

    /**
     * @Description: 查询消防设备
     * @param: Map<String, String>
     * @return: List<Vehicle>
     * @author: minsheng
     * @date: 2019/1/14 15:04
     */
    @PostMapping("/sensor/device/list")
    Result getFireDeviceAllHouse(@RequestParam Map<String, Object> map1);

    /**
     * @Description: 获取WiFi探针列表
     * @param: Map<String, String>
     * @return: List<Map<String,Object>>
     * @author: minsheng
     * @date: 2019/1/14 15:18
     */
    @PostMapping("/wifi/device/list")
    Result getWifiDeviceList(@RequestParam Map<String, String> map);
    /**
     * @Description: 查询wifi设备数量
     * @param: recordMap
     * @return: int
     * @author: minsheng
     * @date: 2019/1/15 14:50
     */
    @PostMapping("/wifi/device/count")
    JSONObject getWifiDeviceCount(@RequestParam Map<String, Object> recordMap);
    /**
     * @Description: 查询消防设备
     * @param: recordMap
     * @return: List<FireDevice>
     * @author: minsheng
     * @date: 2019/1/15 14:54
     */
    @PostMapping("/sensor/device/countGroupByType")
    Result getFireDevice(@RequestParam Map<String, Object> recordMap);
    /**
     * @Description: 查询窨井盖设备数量
     * @param: map
     * @return: int
     * @author: minsheng
     * @date: 2019/1/15 14:59
     */
    @PostMapping("/cover/device/count")
    JSONObject getManholecoverCount(@RequestParam Map<String, Object> map);
    /**
     * @Description: 查询微型消防站设备数量
     * @param: map
     * @return: int
     * @author: minsheng
     * @date: 2019/1/15 14:59
     */
    @PostMapping("/fireStation/count")
    JSONObject getFireFightingCount(@RequestParam Map<String, Object> recordMap);

    /**
     * @Description: 查询门禁设备数量
     * @param: recordMap
     * @return: int
     * @author: minsheng
     * @date: 2019/1/15 14:27
     */
    @PostMapping("/access/device/count")
    JSONObject getAccessDeviceCount(@RequestParam Map<String, Object> recordMap);

    /**
     * @Description: 查询相机类型及数量
     * @param: map
     * @return: List<Camera>
     * @author: minsheng
     * @date: 2019/1/15 15:01
     */
    @PostMapping("/camera/device/countGroupByCameraType")
    Result getCamera(@RequestParam Map<String, Object> map);

    /**
     * @Description: 查询相机
     */
    @RequestMapping(value = "/camera/device/list", produces = "application/json;charset=utf-8", method = RequestMethod.GET)
    Result<List<Camera>> getCameraList(@RequestParam Map<String, Object> map);

}
